using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace HRM.Models.Mapping
{
    public class DonViMap : EntityTypeConfiguration<DonVi>
    {
        public DonViMap()
        {
            // Primary Key
            this.HasKey(t => t.MaDV);

            // Properties
            this.Property(t => t.MaDV)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.TenDV)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("DonVi");
            this.Property(t => t.MaDV).HasColumnName("MaDV");
            this.Property(t => t.TenDV).HasColumnName("TenDV");
        }
    }
}
